﻿/************************************************************************************
 *      Copyright (C) 2015 yuwei,All Rights Reserved
 *      File:
 *                Person.cs
 *      Description:
 *              单例模式示例类
 *      Author:
 *                Yangxianwen
 *                
 *                
 *      Finish DateTime:
 *                2017年07月24日
 *      History:
 ***********************************************************************************/

using System;

namespace Singleton
{
    public class Person
    {

        private static Person _person { set; get; } = null;

        /// <summary>
        /// 构造函数
        /// </summary>
        private Person()
        {
            Console.WriteLine("构造了一个person");
        }

        public static Person GetInstance()
        {
            if(_person == null)
                _person = new Person();
            return _person;
        }

    }
}
